#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: base00_common.py 
@version:
@time: 2022/03/05 
"""
from TapClientCaseData.ColumnGenerateData.dynamic.base.base00_dynamic import COMMON_TYPE, NODE
from TapClientCaseData.ColumnGenerateData.dynamic.dynamic_door import *

BASE_MYSQL = COMMON_TYPE.get('MYSQL').get('BASE')
BASE_ORACLE = COMMON_TYPE.get('ORACLE').get('BASE')
BASE_MONGODB = COMMON_TYPE.get('MONGODB').get('BASE')
BASE_POSTGRES = COMMON_TYPE.get('POSTGRES').get('BASE')
BASE_SQLSERVER = COMMON_TYPE.get('SQLSERVER').get('BASE')
BIGINT_SQLSERVER = COMMON_TYPE.get('SQLSERVER').get('BIGINT')
BASE_KAFKA = COMMON_TYPE.get('KAFKA').get('BASE')
BASE_DB2 = COMMON_TYPE.get('DB2').get('BASE')


class DynamicBase:
    # CREATE
    BASE_MYSQL_CREATE = BASE_MYSQL.get('CREATE')
    BASE_ORACLE_CREATE = BASE_ORACLE.get('CREATE')
    BASE_MONGODB_CREATE = BASE_MONGODB.get('CREATE')
    BASE_POSTGRES_CREATE = BASE_POSTGRES.get('CREATE')
    BASE_SQLSERVER_CREATE = BASE_SQLSERVER.get('CREATE')
    BIGINT_SQLSERVER_CREATE = BIGINT_SQLSERVER.get('CREATE')
    BASE_KAFKA_CREATE = BASE_KAFKA.get('CREATE')
    BASE_DB2_CREATE = BASE_DB2.get('CREATE')
    # INSERT
    BASE_MYSQL_INSERT_1 = BASE_MYSQL.get('INSERT_1')
    BASE_ORACLE_INSERT_1 = BASE_ORACLE.get('INSERT_1')
    BASE_MONGODB_INSERT_1 = None
    BASE_POSTGRES_INSERT_1 = BASE_POSTGRES.get('INSERT_1')
    BASE_SQLSERVER_INSERT_1 = BASE_SQLSERVER.get('INSERT_1')
    BASE_KAFKA_INSERT_1 = None
    BASE_DB2_INSERT_1 = BASE_DB2.get('INSERT_1')
    BASE_MYSQL_INSERT_2 = BASE_MYSQL.get('INSERT_2')
    BASE_ORACLE_INSERT_2 = BASE_ORACLE.get('INSERT_2')
    BASE_MONGODB_INSERT_2 = BASE_MONGODB.get('INSERT')
    BASE_POSTGRES_INSERT_2 = BASE_POSTGRES.get('INSERT_2')
    BASE_SQLSERVER_INSERT_2 = BASE_SQLSERVER.get('INSERT_2')
    BASE_KAFKA_INSERT_2 = BASE_KAFKA.get('INSERT')
    BASE_DB2_INSERT_2 = BASE_DB2.get('INSERT_2')

    BASE_MYSQL_INSERT_MOREDATA = BASE_MYSQL.get('INSERT_MORE_DATA')
    BASE_ORACLE_INSERT_MOREDATA = BASE_ORACLE.get('INSERT_MORE_DATA')
    BASE_MONGODB_INSERT_MOREDATA = BASE_MONGODB.get('INSERT_MORE_DATA')
    BASE_POSTGRES_INSERT_MOREDATA = BASE_POSTGRES.get('INSERT_MORE_DATA')
    BASE_SQLSERVER_INSERT_MOREDATA = BASE_SQLSERVER.get('INSERT_MORE_DATA')
    BASE_KAFKA_INSERT_MOREDATA = BASE_KAFKA.get('INSERT_MORE_DATA')
    # UPDATE
    BASE_MYSQL_UPDATE = BASE_MYSQL.get('UPDATE')
    BASE_ORACLE_UPDATE = BASE_ORACLE.get('UPDATE')
    BASE_MONGODB_UPDATE = BASE_MONGODB.get('UPDATE')
    BASE_POSTGRES_UPDATE = BASE_POSTGRES.get('UPDATE')
    BASE_SQLSERVER_UPDATE = BASE_SQLSERVER.get('UPDATE')
    BASE_KAFKA_UPDATE = BASE_KAFKA.get('UPDATE')
    BASE_DB2_UPDATE = BASE_DB2.get('UPDATE')
    # WHERE
    BASE_MYSQL_WHERE = BASE_MYSQL.get('WHERE')
    BASE_ORACLE_WHERE = BASE_ORACLE.get('WHERE')
    BASE_MONGODB_WHERE = BASE_MONGODB.get('WHERE')
    BASE_POSTGRES_WHERE = BASE_POSTGRES.get('WHERE')
    BASE_SQLSERVER_WHERE = BASE_SQLSERVER.get('WHERE')
    BASE_KAFKA_WHERE = BASE_KAFKA.get('WHERE')
    BASE_DB2_WHERE = BASE_DB2.get('WHERE')
    # MORE DATA WHERE
    MOREDATA_MYSQL_WHERE = BASE_MYSQL.get('WHERE_MORE_DATA')
    MOREDATA_ORACLE_WHERE = BASE_ORACLE.get('WHERE_MORE_DATA')
    MOREDATA_MONGODB_WHERE = BASE_MONGODB.get('WHERE_MORE_DATA')
    MOREDATA_POSTGRES_WHERE = BASE_POSTGRES.get('WHERE_MORE_DATA')
    MOREDATA_SQLSERVER_WHERE = BASE_SQLSERVER.get('WHERE_MORE_DATA')
    MOREDATA_KAFKA_WHERE = BASE_KAFKA.get('WHERE_MORE_DATA')


class DynamicDataType:
    # CREATE
    DATATYPE_MYSQL_CREATE = MYSQL_ALL_TYPE_COLUMNS
    DATATYPE_MYSQL57_CREATE = MYSQL_ALL_TYPE_COLUMNS57
    DATATYPE_ORACLE_CRATE = ORACLE_ALL_TYPE_COLUMNS
    DATATYPE_MONGODB_CREATE = MONGODB_ALL_TYPE
    DATATYPE_POSTGRES_CREATE = POSTGRES_ALL_TYPE_COLUMNS
    DATATYPE_SQLSERVER_CREATE = SQLSERVER_ALL_TYPE_COLUMNS
    # INSERT
    DATATYPE_MYSQL_INSERT = DML_MYSQL_ALL_INSERT
    DATATYPE_MYSQL57_INSERT = DML_MYSQL_ALL_INSERT57
    DATATYPE_ORACLE_INSERT = DML_ORA_ALL_INSERT_1
    DATATYPE_MONGODB_INSERT = None
    DATATYPE_POSTGRES_INSERT = DML_POSTGRES_ALL_INSERT_1
    DATATYPE_SQLSERVER_INSERT = DML_SQLSERVER_ALL_INSERT_1

    DATATYPE_MYSQL_INSERT_2 = DML_MYSQL_ALL_INSERT
    DATATYPE_MYSQL57_INSERT_2 = DML_MYSQL_ALL_INSERT57
    DATATYPE_ORACLE_INSERT_2 = DML_ORA_ALL_INSERT_2
    DATATYPE_MONGODB_INSERT_2 = MONGODB_ALL_TYPE_INSERT
    DATATYPE_POSTGRES_INSERT_2 = DML_POSTGRES_ALL_INSERT_2
    DATATYPE_SQLSERVER_INSERT_2 = DML_SQLSERVER_ALL_INSERT_2
    # UPDATE
    DATATYPE_MYSQL_UPDATE = DML_MYSQL_ALL_UPDATE
    DATATYPE_MYSQL57_UPDATE = DML_MYSQL_ALL_UPDATE57
    DATATYPE_ORACLE_UPDATE = DML_ORA_ALL_UPDATE
    DATATYPE_MONGODB_UPDATE = MONGODB_ALL_TYPE_UPDATE
    DATATYPE_POSTGRES_UPDATE = DML_POSTGRES_ALL_UPDATE
    DATATYPE_SQLSERVER_UPDATE = DML_SQLSERVER_ALL_UPDATE
    # WHERE
    BASE_MYSQL_WHERE = BASE_MYSQL.get('WHERE')
    BASE_ORACLE_WHERE = BASE_ORACLE.get('WHERE')
    BASE_MONGODB_WHERE = BASE_MONGODB.get('WHERE')
    BASE_POSTGRES_WHERE = BASE_POSTGRES.get('WHERE')
    BASE_SQLSERVER_WHERE = BASE_SQLSERVER.get('WHERE')
    BASE_KAFKA_WHERE = BASE_KAFKA.get('WHERE')
    # MORE DATA WHERE
    MOREDATA_MYSQL_WHERE = BASE_MYSQL.get('WHERE_MORE_DATA')
    MOREDATA_ORACLE_WHERE = BASE_ORACLE.get('WHERE_MORE_DATA')
    MOREDATA_MONGODB_WHERE = BASE_MONGODB.get('WHERE_MORE_DATA')
    MOREDATA_POSTGRES_WHERE = BASE_POSTGRES.get('WHERE_MORE_DATA')
    MOREDATA_SQLSERVER_WHERE = BASE_SQLSERVER.get('WHERE_MORE_DATA')
    MOREDATA_KAFKA_WHERE = BASE_KAFKA.get('WHERE_MORE_DATA')


NODE_MYSQL = NODE.get('MYSQL').get('NODE')
NODE_ORACLE = NODE.get('ORACLE').get('NODE')
NODE_MONGODB = NODE.get('MONGODB').get('NODE')
NODE_POSTGRES = NODE.get('POSTGRES').get('NODE')
NODE_SQLSERVER = NODE.get('SQLSERVER').get('NODE')
NODE_KAFKA = NODE.get('KAFKA').get('NODE')
NODE_DB2 = NODE.get('DB2').get('NODE')


class DynamicNode:
    # CREATE
    NODE_MYSQL_CREATE = NODE_MYSQL.get('CREATE')
    NODE_ORACLE_CREATE = NODE_ORACLE.get('CREATE')
    NODE_MONGODB_CREATE = NODE_MONGODB.get('CREATE')
    NODE_POSTGRES_CREATE = NODE_POSTGRES.get('CREATE')
    NODE_SQLSERVER_CREATE = NODE_SQLSERVER.get('CREATE')
    NODE_KAFKA_CREATE = NODE_KAFKA.get('CREATE')
    NODE_DB2_CREATE = NODE_DB2.get('CREATE')
    # INSERT
    NODE_MYSQL_INSERT_1 = NODE_MYSQL.get('INSERT_1')
    NODE_ORACLE_INSERT_1 = NODE_ORACLE.get('INSERT_1')
    NODE_MONGODB_INSERT_1 = None
    NODE_POSTGRES_INSERT_1 = NODE_POSTGRES.get('INSERT_1')
    NODE_SQLSERVER_INSERT_1 = NODE_SQLSERVER.get('INSERT_1')
    NODE_KAFKA_INSERT_1 = None
    NODE_DB2_INSERT_1 = NODE_DB2.get('INSERT_1')
    NODE_MYSQL_INSERT_2 = NODE_MYSQL.get('INSERT_2')
    NODE_ORACLE_INSERT_2 = NODE_ORACLE.get('INSERT_2')
    NODE_MONGODB_INSERT_2 = NODE_MONGODB.get('INSERT')
    NODE_POSTGRES_INSERT_2 = NODE_POSTGRES.get('INSERT_2')
    NODE_SQLSERVER_INSERT_2 = NODE_SQLSERVER.get('INSERT_2')
    NODE_KAFKA_INSERT_2 = NODE_KAFKA.get('INSERT')
    NODE_DB2_INSERT_2 = NODE_DB2.get('INSERT_2')

    NODE_MYSQL_INSERT_MOREDATA = NODE_MYSQL.get('INSERT_MORE_DATA')
    NODE_ORACLE_INSERT_MOREDATA = NODE_ORACLE.get('INSERT_MORE_DATA')
    NODE_MONGODB_INSERT_MOREDATA = NODE_MONGODB.get('INSERT_MORE_DATA')
    NODE_POSTGRES_INSERT_MOREDATA = NODE_POSTGRES.get('INSERT_MORE_DATA')
    NODE_SQLSERVER_INSERT_MOREDATA = NODE_SQLSERVER.get('INSERT_MORE_DATA')
    NODE_KAFKA_INSERT_MOREDATA = NODE_KAFKA.get('INSERT_MORE_DATA')
    # UPDATE
    NODE_MYSQL_UPDATE = NODE_MYSQL.get('UPDATE')
    NODE_ORACLE_UPDATE = NODE_ORACLE.get('UPDATE')
    NODE_MONGODB_UPDATE = NODE_MONGODB.get('UPDATE')
    NODE_POSTGRES_UPDATE = NODE_POSTGRES.get('UPDATE')
    NODE_SQLSERVER_UPDATE = NODE_SQLSERVER.get('UPDATE')
    NODE_KAFKA_UPDATE = NODE_KAFKA.get('UPDATE')
    NODE_DB2_UPDATE = NODE_DB2.get('UPDATE')
    # WHERE
    NODE_MYSQL_WHERE = NODE_MYSQL.get('WHERE')
    NODE_ORACLE_WHERE = NODE_ORACLE.get('WHERE')
    NODE_MONGODB_WHERE = NODE_MONGODB.get('WHERE')
    NODE_POSTGRES_WHERE = NODE_POSTGRES.get('WHERE')
    NODE_SQLSERVER_WHERE = NODE_SQLSERVER.get('WHERE')
    NODE_KAFKA_WHERE = NODE_KAFKA.get('WHERE')
    NODE_DB2_WHERE = NODE_DB2.get('WHERE')
    # MORE DATA WHERE
    NODE_MOREDATA_MYSQL_WHERE = NODE_MYSQL.get('WHERE_MORE_DATA')
    NODE_MOREDATA_ORACLE_WHERE = NODE_ORACLE.get('WHERE_MORE_DATA')
    NODE_MOREDATA_MONGODB_WHERE = NODE_MONGODB.get('WHERE_MORE_DATA')
    NODE_MOREDATA_POSTGRES_WHERE = NODE_POSTGRES.get('WHERE_MORE_DATA')
    NODE_MOREDATA_SQLSERVER_WHERE = NODE_SQLSERVER.get('WHERE_MORE_DATA')
    NODE_MOREDATA_KAFKA_WHERE = NODE_KAFKA.get('WHERE_MORE_DATA')


DDL_MYSQL = COMMON_TYPE.get('MYSQL').get('DDL')
DDL_PG = COMMON_TYPE.get('POSTGRES').get('DDL')


class DynamicDDL:
    # CREATE
    DDL_MYSQL_CREATE = DDL_MYSQL.get('CREATE')
    DDL_PG_CREATE = DDL_PG .get('CREATE')
    # INSERT
    DDL_MYSQL_INSERT_1 = DDL_MYSQL.get('INSERT_1')
    DDL_PG_INSERT_1 = DDL_PG .get('INSERT_1')

    DDL_MYSQL_INSERT_2 = DDL_MYSQL.get('INSERT_2')
    DDL_PG_INSERT_2 = DDL_PG .get('INSERT_2')
    # UPDATE
    DDL_MYSQL_UPDATE = DDL_MYSQL.get('UPDATE1')
    DDL_MYSQL_UPDATE2 = DDL_MYSQL.get('UPDATE2')
    DDL_PG_UPDATE = DDL_PG .get('UPDATE1')
    DDL_PG_UPDATE2 = DDL_PG .get('UPDATE2')
    # WHERE
    DDL_MYSQL_WHERE = DDL_MYSQL.get('WHERE')
    DDL_PG_WHERE = DDL_PG .get('WHERE')
